package top.forforever.srb.core.controller.admin;

import io.swagger.annotations.ApiOperation;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import top.forforever.srb.common.result.R;

/**
 * @create: 2023/4/30
 * @Description:
 * @FileName: AdminUserController
 * @自定义内容：
 */
@RestController
@RequestMapping("/admin/core/user")
public class AdminUserController {

    @ApiOperation(value = "后台登录接口")
    @PostMapping("/login")
    public R adminLogin() {
        return R.ok().data("token","admin-token");
    }

    @ApiOperation(value = "后台登录成功回显数据")
    @GetMapping("/info")
    public R info() {
        return R.ok().data("roles","[admin]")
                .data("introduction","I am a super administrator")
                .data("avatar",
                        "https://ts1.cn.mm.bing.net/th/id/R-C.2803d321236c432e542cfbff22c9f165?rik=YqMQZ4MW0XXQeA&riu=http%3a%2f%2fwww.gx8899.com%2fuploads%2fallimg%2f2017110610%2fsyg34bwbcbr.jpg&ehk=Ys36DpXgJB8YCeisYM7EbVqHW8hNrzE3csocfDopLWU%3d&risl=&pid=ImgRaw&r=0")
                .data("name","Super Admin");
    }

    @ApiOperation(value = "后台退出登录")
    @PostMapping("/logout")
    public R logout(){
        return R.ok().data("token","");
    }

}
